package com.hxh.wechat

import android.content.Intent
import com.hxh.wechat.activity.Router
import com.hxh.wechat.api.UserApi
import com.hxh.wechat.util.getDeviceId
import okhttp3.*
import org.junit.Assert.*
import org.junit.Test
import java.io.IOException


/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
class ExampleUnitTest {
    @Test
    fun addition_isCorrect() {
        println("Failed.")
        println("Failed.")

        UserApi.login("hxh", "123","!2312")?.enqueue(
            object : Callback {
                override fun onFailure(call: Call, e: IOException) {
                    println("Failed.")
                    println(e.stackTrace.toString())
                }

                @Throws(IOException::class)
                override fun onResponse(call: Call, response: Response) {
                    val responseData = response.body?.string()
                    // 处理响应数据
                    println(responseData)
                    // 登录成功，跳转到主界面
                }
            })
    }
}